<template>
    <div class="cadreInfo"> 
        <!--本县人物介绍 -->
        <div class="people_intro" v-if="countyInfo.cadreList.length > 0">
            <div v-for="(item,index) in countyInfo.cadreList" :key="index" style="border-bottom:none">
                <div class="intro_li">
                    <div class="people_img">
                        <img :src='imgUrl+item.cadreAvatar'>
                    </div>
                    <div class="intro_list">
                        <div class="intro_title">姓名：</div> 
                        <div class="intro_content">{{item.cadreName}}</div> 
                        <br>
                        <div class="intro_title">职务：</div> 
                        <div class="intro_content">{{item.cadrePosition}}</div> 
                        <br>
                        <div class="intro_title">地区：</div> 
                        <div class="intro_content">{{countyInfo.countyArea}}</div> 
                    </div>
                </div>
                <div class="intro_li">
                    <div class="intro_title">
                        介绍：
                    </div> 
                    <div class="intro_content" v-html="item.cadreIntro">
                    </div> 
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'cadreInfo',
    data() {
        return {
            imgUrl: this.CONSTANT.imgBaseUrl,
            countyInfo: {},
            cadreId: '',
            countyId: '',
        }
    },
    created: function() {
        this.cadreId = this.$route.query.cadreId;
        this.countyId = this.$route.query.countyId;
        this.init();
    },
    methods: {
        init() {
            // 本县扶贫干部信息的取得
            this.$dialog.loading.open('请稍后');
            this.$axios.get(this.CONSTANT.wapiBaseUrl + 'supportPoor/cadreInfo?countyId=' + this.countyId + '&cadreId=' + this.cadreId)
                .then((response) => {
                    this.$dialog.loading.close();
                    if (response.status == 200) {
                        this.countyInfo = response.data.object;
                    }
                    
                }).catch((error) => {
                    this.$dialog.loading.close();
                    this.$dialog.toast({
                        mes: '本县扶贫干部信息的取得失败，请联系客服',
                        icon: 'error',
                        timeout: 1500
                    });
                });
        }
    }
}
</script>

<style scoped> 
.cadreInfo {
    width: 100%;
    margin: 0 auto;
    color: #727272;
    height: 100%;
    background-color:#FFF;
}

.people_intro {
    width: 100%;
    background: #fff;
    height: auto;
    margin-bottom: 5px;
}
.intro_li {
    width: 100%;
    /* height: 2rem; */
    padding-top: 5px;
    padding-bottom: 5px;
    overflow: hidden;
}

.intro_li:last-of-type {
    border-bottom: 0;
}

.intro_li .people_img {
    float: left;
    padding-left: 0.2rem;
    padding-top: 0.3rem;
    width: 1.8rem;
    height: 100%;
    overflow: hidden;
}

.people_img img {
    width: 100%;
    height: auto;
    min-height: 100%;
}

.intro_list {
    /* float: left; */
    /* width: calc(100% - 2.5rem); */
    padding-left: 0.5rem;
    height: 100%;
    box-sizing: border-box;
    padding-top: 0.3rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intro_title {
    float: left;
    padding-left: 0.2rem;
    height: 100%;
    font-size: 16px;
    overflow: hidden;
}
.intro_content {
    overflow:hidden;
    padding-left:0.2rem;
    padding-right:0.2rem;
    font-size:16px;
}
</style>